#include <stdio.h>
#include <time.h>
#include <windows.h>

int main()
{
    time_t t = 0;
    FILE *fp = fopen("output.txt", "w");
    while (1)
    {
        time(&t);

        struct tm *p = localtime(&t);
        fprintf(fp, "t:%lld tm_isdst:%d\n", t,p->tm_isdst);

        char szBuf[100] = { 0 };
        strftime(szBuf, sizeof(szBuf), "DateTime:%Y-%m-%d %H:%M:%S", p);
        fprintf(fp, "%s\n", szBuf);
        fflush(fp);
        Sleep(1000);
    }
    fclose(fp);
    fp = NULL;
    return 0;
}